import { Logger } from '@/utils/logger';
import { TaskBase } from '../TaskBase';

export class TaskClaim extends TaskBase {
    shouldRun(creep: Creep): boolean {
        return true;
    }
    _run(creep: Creep) {
        return this.defaultProcess(creep.claimController(<StructureController>this.target), () => {
            creep.say('🚩CLAIMED', true);   // 宣告世界！
            Logger.info(`成功占领了新的房间 ${this.targetPos.roomName}！`, 'expand');
            Empire.needsRebuilding = true;     // 下一 tick 准备重建帝国数据
        });
    }
}